package com.ethan.springcloud.helloservice.feign.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author daifei
 * @date 2019/3/21
 */
//@RestController
@Slf4j
public class HelloService {

    @GetMapping("hello")
    public String hello(@RequestParam String name) throws Exception {
//        Thread.sleep(3000);
//        if(1==1){
//            throw new Exception("这是测试降级异常！");
//        }
        return "hello" + name;
    }

    @PostMapping("hello2")
    public String hello2(@RequestBody com.ethan.springclod.api.vo.User user) throws InterruptedException {
        log.info("hello2:{}", user);
        return user.toString();
    }


}
